import request from "@/utils/request";

// 查询公告列表
export function listNotice(query) {
  return request({
    url: "/system/notice/page",
    method: "get",
    params: query,
  });
}

// 查询公告详细
export function getNotice(noticeId) {
  return request({
    url: "/system/notice/get?id=" + noticeId,
    method: "get",
  });
}

// 新增公告
export function addNotice(data) {
  return request({
    url: "/system/notice/create",
    method: "post",
    data: data,
  });
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: "/system/notice/update",
    method: "put",
    data: data,
  });
}

// 删除公告
export function delNotice(noticeId) {
  return request({
    url: "/system/notice/delete?id=" + noticeId,
    method: "delete",
  });
}

// 小铃铛未读数量
export function getSmallBellTotal() {
  return request({
    url: "/system/notice/getSmallBell",
    method: "get",
  });
}

// 获得消息通知分页
export function getMessagePage(query) {
  return request({
    url: "/bpm/message/page",
    method: "get",
    params: query,
  });
}

// 获取通知公告列表
export function getAnnouncementList(query) {
  return request({
    url: "/system/notice/page",
    method: "get",
    params: query,
  });
}

// 获得首页审批统计数据
export function getApproveStatistics(query) {
  return request({
    url: "/bpm/message/getApproveStatistics",
    method: "get",
    params: query,
  });
}

// 修改公告为已读
export function noticeRead(data) {
  return request({
    url: "/system/notice/read",
    method: "POST",
    data: data,
  });
}

// 获取我的公告列表
export function getmyPage(query) {
  return request({
    url: "/system/notice/mypage",
    method: "get",
    params: query,
  });
}
